local CommonOHOH = _G.CommonOHOH;
local ClientOHOH = _G.ClientOHOH;
local M = CommonOHOH.class.new(script, CommonOHOH.files.BaseComponent());
local UIManager = ClientOHOH.load.UIManager();
local HomeGui=UIManager.ui_list.HomeGui


function M.new(self,...)
	return M(self,...);
end;

function M.ctor(self, parent)
	M.super.ctor(self, parent);
    self.Att=_G.ClientOHOH:GetPath_Loop("Touch",self.parent:GetRoot())
    self.parent.FeedEvent:Connect(function()

        local targetPos  = self.Att.Position
        local CodeAnimationTool=_G.CommonOHOH.load.CodeAnimationTool();
     
        local effectId="Effect.fly_base_meat"
        local uiId="base_meat"
        local uipos,uisize= HomeGui:GetItemAbsoluteProperties(uiId)

        local GuiService = game:GetService("GuiService")
        local inset = GuiService:GetGuiInset()
        local topBarHeight = inset.Y

        uipos= Vector2.new(uipos.X, uipos.Y+topBarHeight)
         local uiPosList = {}

         local radius = 50 -- 圆的半径
        local numPoints = 6 -- 需要生成的数量

        for i = 1, numPoints do
      
            local angle = math.pi - (i - 1) * (math.pi / (numPoints - 1))
            local offsetX = radius * math.cos(angle)
            local offsetY = radius * math.sin(angle)
            local newPos = uipos + Vector2.new(offsetX, offsetY)
            uiPosList[i] = newPos
        end

  
        for i,UIpos in pairs(uiPosList) do
            CodeAnimationTool.UiAnimation.screen2World(function()
                return _G.POOL:GetObj(effectId)
            end,function(e)
                _G.POOL:PushObj(effectId,e)
                --HomeGui:AddItem(uiId,count)
            end,targetPos,uipos,UIpos,uisize)
            task.wait(0.1)
        end
end)

end;
function M.screen2World(self)

end
function M.dtor(self)
	M.super.dtor(self);
end

return M

